<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>COLD EYES</title>
<script language="javascript">
	// 자바 스크립트 시작

	function writeCheck() {
		var form = document.writeform;

		if (!form.name.value) // form 에 있는 name 값이 없을 때
		{
			alert("이름을 적어주세요"); // 경고창 띄움
			form.name.focus(); // form 에 있는 name 위치로 이동
			return;
		}

		if (!form.password.value) {
			alert("비밀번호를 적어주세요");
			form.password.focus();
			return;
		}

		if (!form.title.value) {
			alert("제목을 적어주세요");
			form.title.focus();
			return;
		}

		if (!form.memo.value) {
			alert("내용을 적어주세요");
			form.memo.focus();
			return;
		}

		form.submit();
	}
</script>
<style>
#center-img2 {
	background-color: white;
	width: 80%;
	height: 100%;
	float: left;
}

table {
	font-family: '나눔고딕';
	font-size: 11px
}

input {
	font-family : '나눔고딕';
	font-size: 11px
}

textarea{
	font-family : '나눔고딕';
	font-size : 11px
}

</style>


</head>
<body>


		<div id='center-img2'>

			<!-- name에는, "name", "id", "class" 들어갈 수 있다. id는 유일한 값만. 그 외는 중복 가능 -->
	<!-- method 방식에는, get / post 있음. -->
	<!-- get : 데이터 길이 제한있고, 데이터값을 임의로 지정할 수 있다. -->
	<!-- post : 데이터 길이 제한없다. -->
	<form name = "writeform" method=post action="write_ok.jsp">
		<table align='center'>
		<tr height = '50'><td></td></tr>
			<tr>
				<td>
					<table width="100%" cellpadding="0" cellspacing="0" border="0">
						<tr align='center'>
							<td>
							<font style = "font-family : 'Roboto Cn'; font-size : 30px; color : #165aa5; font-weight : bold">
							New Content</font></td>
						</tr>
					</table> <!-- 첫번째 테이블 끝 -->

					<hr color="black">

					<table>
						<tr>
							<td>&nbsp;</td>
							<td align="center">제목</td>
							<td><input type = "text" name="title" size="50" maxlength="100"></td>
							<td>&nbsp;</td>
						</tr>
						<tr height="1" bgcolor="#dddddd">
							<td colspan="4"></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td align="center">이름</td>
							<td><input type = "text" name="name" size="50" maxlength="10"></td>
							<td>&nbsp;</td>
						</tr>
						<tr height="1" bgcolor="#dddddd">
							<td colspan="4"></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td align="center">비밀번호</td>
							<td>
							<input type = "password" name="password" size="10" maxlength="4">
							　<font color = 'red'>* 비밀번호 4자리를 입력</font></td>
							<td>&nbsp;</td>
						</tr>
						<tr height="1" bgcolor="#dddddd">
							<td colspan="4"></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td align="center">내용</td>
							<td><textarea name="memo" cols="50" rows="13"></textarea></td>
							<td>&nbsp;</td>
						</tr>
						<tr height="1" bgcolor="#dddddd">
							<td colspan="4"></td>
						</tr>
						<tr height="1" bgcolor="#82B5DF">
							<td colspan="4"></td>
						</tr>
						<tr align="center" height='50'>
							<td>&nbsp;</td>
							<td colspan="2">
							<input type=button value="등록" OnClick="javascript:writeCheck();">
							<input type=button value="취소" OnClick="history.back()">
							<td>&nbsp;</td>
						</tr>

					</table>
				</td>
			</tr>

		</table>
	</form>

		</div>
	
</body>
</html>